<!DOCTYPE HTML>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<link th:href="@{/uploadeFile/css/common.css}"  rel="stylesheet"/>
<link  th:href="@{/uploadeFile/css/index.css}"   rel="stylesheet"/>
<script src="http://gosspublic.alicdn.com/aliyun-oss-sdk-4.4.4.min.js"></script>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
		<input type="hidden" value="/uploadeFile"  id="staticUrl" >
        <form class="form-horizontal m" id="form-commodity-add">
			<div class="form-group">	
				<label class="col-sm-3 control-label">序号：</label>
				<div class="col-sm-8">
					<input id="sort" name="sort" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">商品名称：</label>
				<div class="col-sm-8">
					<input id="name" name="name" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">商品链接：</label>
				<div class="col-sm-8">
					<input id="url" name="url" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">商品说明：</label>
				<div class="col-sm-8">
					<input id="content" name="content" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">原价格：</label>
				<div class="col-sm-8">
					<input id="price" name="price" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">活动价：</label>
				<div class="col-sm-8">
					<input id="activityPrice" name="activityPrice" class="form-control" type="text">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">logo：</label>
				<div class="col-sm-8">
					<div class="col-sm-8">
						<section class=" img-section" data-limit="1">
							<input type="hidden" id="photo" name="logo" class="getvalue" value="">
							<p class="up-p"><span class="up-span">最多可以上传1张图片</span></p>
							<div class="z_photo upimg-div clear" >
								<section class="z_file fl">
									<img th:src="@{/uploadeFile/img/a11.png}"  class="add-img">
									<input type="file" name="file" id="file" class="file" value="" accept="image/jpg,image/jpeg,image/png,image/bmp" multiple />
								</section>
							</div>
						</section>
						<aside class="mask works-mask">
							<div class="mask-content">
								<p class="del-p ">您确定要删除吗？</p>
								<p class="check-p"><span class="del-com wsdel-ok">确定</span><span class="wsdel-no">取消</span></p>
							</div>
						</aside>
					</div>
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">是否上架：</label>
				<div class="col-sm-8">
					<div class="onoffswitch">
						<input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="shelves1" >
						<label class="onoffswitch-label" for="shelves1">
							<span class="onoffswitch-inner"></span>
							<span class="onoffswitch-switch"></span>
						</label>
					</div>
					<input id="shelves" name="shelves" class="form-control" type="hidden">
				</div>
			</div>
			<div class="form-group">	
				<label class="col-sm-3 control-label">首推：</label>
				<div class="col-sm-8">
					<div class="onoffswitch">
						<input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="known1" >
						<label class="onoffswitch-label" for="known1">
							<span class="onoffswitch-inner"></span>
							<span class="onoffswitch-switch"></span>
						</label>
					</div>
					<input id="known" name="known" class="form-control" type="hidden">
				</div>
			</div>
			<div class="form-group">
				<div class="form-control-static col-sm-offset-9">
					<button type="submit" class="btn btn-primary">提交</button>
					<button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button>
				</div>
			</div>
		</form>
	</div>
    <div th:include="include::footer"></div>
	<script  th:src="@{/uploadeFile/js/imgUp.js}"></script>
    <script type="text/javascript">
		var prefix = ctx + "beautyflower/commodity"
		$("#form-commodity-add").validate({
			rules:{
				xxxx:{
					required:true,
				},
			},
			submitHandler: function(form) {
                var shelves = $("#shelves1").is(':checked') == true ? 1 : 2;
                var known = $("#known1").is(':checked') == true ? 1 : 2;
                $("#shelves").val(shelves);
                $("#known").val(known);
				$.operate.save(prefix + "/add", $('#form-commodity-add').serialize());
			}
		});
	</script>
</body>
</html>
